using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace GameUI {
	public class MinimapIconContainerController:MonoBehaviour {
		void Start() {
			SubscribeEvents();
		}
		void OnDestroy() {
			UnsubscribeEvents();
		}

		void UnsubscribeEvents() {
			MapDisplayController.OpenMap-=MapDisplayController_OpenMap;
			MapDisplayController.CloseMap-=MapDisplayController_CloseMap;
		}
		void SubscribeEvents() {
			MapDisplayController.OpenMap+=MapDisplayController_OpenMap;
			MapDisplayController.CloseMap+=MapDisplayController_CloseMap;
		}

		private void MapDisplayController_CloseMap(object sender) => gameObject.SetActive(true);
		private void MapDisplayController_OpenMap(object sender) => gameObject.SetActive(false);


	}
}